import { businessAxios } from '@/utils/request'

// 查询目录
export const getPrefixList = (data: any) => {
  return businessAxios({
    url: '/api/datamarket/v2/doc-directory/tree',
    method: 'get',
    data
  })
}

// id查询目录文档
export const getFileList = (data: any) => {
  return businessAxios({
    url: '/api/datamarket/file/getFileList',
    method: 'post',
    data
  })
}

// id删除目录文档
export const deleteFileByIds = (data: any) => {
  return businessAxios({
    url: '/api/datamarket/file/deleteFileByIds',
    method: 'post',
    data
  })
}

// 修改目录
export const editPrefixById = (id: any, data: any) => {
  return businessAxios({
    url: `/api/datamarket/v2/doc-directory/${id}`,
    method: 'patch',
    data
  })
}

// 新增目录
export const createPrefix = (data: any) => {
  return businessAxios({
    url: '/api/datamarket/v2/doc-directory/',
    method: 'post',
    data
  })
}

// 删除目录
export const deletePrefixById = (params: any) => {
  return businessAxios({
    url: `/api/datamarket/v2/doc-directory/${params}`,
    method: 'delete'
  })
}
